Skip to content

Fix/anoncreds w3c ios build#45

Open
cbbathaglini wants to merge 5 commits into
LF-Decentralized-Trust-labs:mainfrom
cbbathaglini:fix/anoncreds-w3c-ios-build
Open

Fix/anoncreds w3c ios build#45
cbbathaglini wants to merge 5 commits into
LF-Decentralized-Trust-labs:mainfrom
cbbathaglini:fix/anoncreds-w3c-ios-build

Conversation

@cbbathaglini

Copy link
Copy Markdown

This PR updates the Swift bindings generated by UniFFI and adjusts the Swift tests to match the current method names exposed by the generated wrappers.

The main goal is to make the anoncreds W3C APIs available from Swift/iOS while keeping the PR scope limited to the wrappers and the required build/test adjustments.

What Changed

  • Updated the Swift bindings generated by UniFFI:
    • swift/Sources/Anoncreds/anoncreds_uniffi.swift
    • swift/Sources/Askar/askar_uniffi.swift
    • swift/Sources/IndyVdr/indy_vdr_uniffi.swift
  • Updated the anoncreds Swift binding to expose the W3C-related types and methods required from Swift/iOS, including:
    • W3cCredential
    • W3cProcess
    • W3C credential processing in the prover flow
  • Updated Swift tests to use the current method names generated by UniFFI:
    • pool.close() -> pool.closePool()
    • session.close() -> session.closeSession()
    • store.close() -> store.closeStore()
  • Added auxiliary Gradle/Kotlin adjustments used while generating/building the wrappers.

Tests

Kotlin/JVM

The Kotlin/JVM tests were executed successfully:

./gradlew :anoncreds_uniffi:jvmTest :askar_uniffi:jvmTest :indy_vdr_uniffi:jvmTest --rerun-tasks

Result:

BUILD SUCCESSFUL

indyVDR Test

The indyVDR test in kotlin/indy-vdr/src/commonTest/kotlin/TestVDR.kt remains disabled because it depends on an external Indy ledger/pool defined by the BCovrin genesis file.

When executed locally, it failed with:

indy_vdr_uniffi.ErrorCode$PoolTimeout

This indicates that the external ledger nodes were unavailable or unreachable from the local environment. The failure is related to an external environment dependency, not to the main change in this PR.

Swift

Swift validation was attempted with locally rebuilt XCFrameworks:

./build-swift-framework.sh
USE_LOCAL_XCFRAMEWORK=1 swift test

The generated Swift bindings compile against the local XCFrameworks. However, the full Swift test target does not start running because SwiftPM links the three Rust-based XCFrameworks into a single test executable.

Since the current packaging model uses static Rust libraries inside the frameworks, the linker reports duplicated Rust runtime symbols, such as:

duplicate symbol '_rust_eh_personality'

This packaging model already exists in the upstream repository, so this PR does not change it in order to keep the scope limited.

Notes

The diff in the Swift files is large because they are generated by UniFFI. The main functional change is making the types and methods required to work with anoncreds W3C credentials available from Swift/iOS.

Signed-off-by: Carine Bertagnolli Bathaglini <cbbathaglini@gmail.com>
Signed-off-by: Carine Bertagnolli Bathaglini <cbbathaglini@gmail.com>
Signed-off-by: Carine Bertagnolli Bathaglini <cbbathaglini@gmail.com>
@cbbathaglini cbbathaglini force-pushed the fix/anoncreds-w3c-ios-build branch from ccea89b to 4dba536 Compare July 2, 2026 12:54
@conanoc

conanoc commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Looks good. I think we don't need to change README.md to explain this change.

@TheTreek Could you review the changes in ‎kotlin/anoncreds/build.gradle.kts?

@conanoc conanoc requested review from TheTreek and conanoc July 7, 2026 03:01
@conanoc conanoc self-assigned this Jul 7, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't these changes break the 16kb page requirement for Google play?

@cbbathaglini cbbathaglini Jul 7, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheTreek

Thank you for the review! That's a valid concern. At the time of your comment (commit 4dba536), the anoncreds build.gradle.kts did not have the RUSTFLAGS for 16KB page size — you were right to call that out.

In the latest commits (f877234 and 10638f9/77acd20), we've addressed this:

  • Added the 16KB page size flags to anoncreds's cargo.builds.android block — the same RUSTFLAGS that askar and indy-vdr already had.
  • Updated NDK to 28.2.13676358 — matching askar and indy-vdr.
  • The remaining changes are just aligning the project structure (unifying duplicate builds blocks, macos block for local dev, version catalog for dependencies) and don't affect Android.

The final result is that anoncreds now has the same Android build configuration as askar and indy-vdr, including the 16KB page size compatibility. No regression was introduced.

@conanoc conanoc assigned cbbathaglini and unassigned conanoc Jul 7, 2026
Signed-off-by: Carine Bertagnolli Bathaglini <cbbathaglini@gmail.com>
Signed-off-by: Carine Bertagnolli Bathaglini <cbbathaglini@gmail.com>
@cbbathaglini cbbathaglini force-pushed the fix/anoncreds-w3c-ios-build branch from 10638f9 to 77acd20 Compare July 7, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants